package cloud.keveri.registry.api;

import cloud.keveri.gateway.dto.ServiceDefinition;
import cloud.keveri.gateway.dto.ServiceInstance;
import cloud.keveri.gateway.dto.KeveriClientConfigure;
import cloud.keveri.spi.SPI;

/**
 * <p>
 * 作者：沈自在
 **/
@SPI
public interface InstanceRegisterRepository {

    /**
     *
     */
    default void init(KeveriClientConfigure configure) {

    }

    ;

    /**
     *
     */
    void register(ServiceDefinition serviceDefinition, ServiceInstance serviceInstance);

    /**
     *
     */
    void deregister(ServiceDefinition serviceDefinition, ServiceInstance serviceInstance);

    /**
     *
     */
    default void closeRepository() {

    }

    ;


    /**
     * 订阅服务变更
     */
    void subscribeTotalGatewayServices(GatewayServiceListener listener);
}
